const { defineConfig } = require('@vue/cli-service')

module.exports = defineConfig({
  transpileDependencies: true,
  chainWebpack: config => {
    config.plugin('define').tap(definitions => {
      Object.assign(definitions[0]['process.env'], {
        NODE_HOST: '"http://localhost:8888"'
      });
      return definitions;
    });
  },
  devServer: {
    proxy: {  //进行代理转发
      '/flask': {
        // 转发的网址
        target: "http://127.0.0.1:5000",
        // 是否开启本地代理 默认true
        changeOrigin: true,
        // 重要点
        pathRewrite: {
          '^/flask': ''
        }
      }
    }
  }
})
